import Vue from 'vue'
import Router from 'vue-router'

// 布局
import layout from '@/page/layout/Index'
import government from '@/page/government/index'
import parkInput from '@/page/government/parkInput'



console.log(layout, 1111)
console.log(government, 2222)

Vue.use(Router)
let routeObj = {
    routes: [
        {
            path: '/',
            name: '首页2',
            // component: layout,
            redirect: '/government/index',
            meta: {
                notRequire: true
            }
        },
        {
            path: '/government',
            name: '首页',
            component: layout,
            meta: {
                notRequire: true
            },
            children: [{
                path: 'index',
                name: '首页1',
                component: government
            }]
        },
        {
            path: '/parkInput',
            name: '停车输入页',
            component: parkInput,
            meta: {
                notRequire: true
            },
            children: []
        },
    ]
}
let router = new Router(routeObj)


const originalPush = Router.prototype.push
   Router.prototype.push = function push(location) {
   return originalPush.call(this, location).catch(err => err)
}

export default router